//血糖导航
function sugarTabbarInit() {
  return [
    { "current":0,
      "pagePath": "/subPages/glucometer/index/index",
      "iconPath": "/resources/tarBar/icon1Black.png",
      "selectedIconPath": "/resources/tarBar/icon1Blue.png",
      "text": "设备数据"
    },
    {
      "current": 0,
      "pagePath": "/subPages/glucometer/history/history",
      "iconPath": "/resources/tarBar/icon2Black.png",
      "selectedIconPath": "/resources/tarBar/icon2Blue.png",
      "text": "历史趋势"
    },
    {
      "current": 0,
      "pagePath": "/subPages/mine/my/my",
      "iconPath": "/resources/tarBar/icon3Black.png",
      "selectedIconPath": "/resources/tarBar/icon3Blue.png",
      "text": "我的",
      "type": "血糖"
    }
  ]
}
//血糖tabbar 主入口
function SugarTabbar(bindName = "tabBar", id, target) {
  var that = target;
  var bindData = {};
  var otabbar = sugarTabbarInit();
  otabbar[id]['iconPath'] = otabbar[id]['selectedIconPath']//换当前的icon
  otabbar[id]['current'] = 1;
  bindData[bindName] = otabbar
  that.setData({ bindData });
}

//血压导航
function pressureTabbarInit() {
  return [
    { "current":0,
      "pagePath": "/subPages/pressure/index/index",
      "iconPath": "/resources/tarBar/icon1Black.png",
      "selectedIconPath": "/resources/tarBar/icon1Blue.png",
      "text": "设备数据"
    },
    {
      "current": 0,
      "pagePath": "/subPages/pressure/history/history",
      "iconPath": "/resources/tarBar/icon2Black.png",
      "selectedIconPath": "/resources/tarBar/icon2Blue.png",
      "text": "历史趋势"
    },
    {
      "current": 0,
      "pagePath": "/subPages/mine/my/my",
      "iconPath": "/resources/tarBar/icon3Black.png",
      "selectedIconPath": "/resources/tarBar/icon3Blue.png",
      "text": "我的",
      "type": "血压"
    }
  ]
}
//血压tabbar 主入口
function pressureTabbar(bindName = "tabBar", id, target) {
  var that = target;
  var bindData = {};
  var otabbar = pressureTabbarInit();
  otabbar[id]['iconPath'] = otabbar[id]['selectedIconPath']//换当前的icon
  otabbar[id]['current'] = 1;
  bindData[bindName] = otabbar
  that.setData({ bindData });
}

//体脂秤导航
function bodyFatTabbarInit() {
  return [
    { "current":0,
      "pagePath": "/subPages/bodyFat/index/index",
      "iconPath": "/resources/tarBar/icon1Black.png",
      "selectedIconPath": "/resources/tarBar/icon1Blue.png",
      "text": "体脂秤"
    },
    {
      "current": 0,
      "pagePath": "/subPages/bodyFat/bodyTrend/bodyTrend",
      "iconPath": "/resources/tarBar/icon2Black.png",
      "selectedIconPath": "/resources/tarBar/icon2Blue.png",
      "text": "体趋势"
    },
    {
      "current": 0,
      "pagePath": "/subPages/mine/my/my",
      "iconPath": "/resources/tarBar/icon3Black.png",
      "selectedIconPath": "/resources/tarBar/icon3Blue.png",
      "text": "我的",
      "type": "体脂秤"
    }
  ]
}
//血压tabbar 主入口
function bodyFatTabbar(bindName = "tabBar", id, target) {
  var that = target;
  var bindData = {};
  var otabbar = bodyFatTabbarInit();
  otabbar[id]['iconPath'] = otabbar[id]['selectedIconPath']//换当前的icon
  otabbar[id]['current'] = 1;
  bindData[bindName] = otabbar
  that.setData({ bindData });
}

module.exports = {
  SugarTabbar: SugarTabbar,
  pressureTabbar: pressureTabbar,
  bodyFatTabbar: bodyFatTabbar
}